<%--
    Document   : addquestion
    Created on : 2012-3-6, 17:00:39
    Author     : xiaoxiao
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib  prefix="s"  uri="/struts-tags"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>编辑选择题</title>
        <link href="css/global.css" rel="stylesheet" type="text/css">
        <link href="css/form.css" rel="stylesheet" type="text/css">
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript" src="js/jquery.validate.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('#signup').validate({
                    rules: {
                        chapter: {
                            required: true,
                            digits:true
                        }
                    }, //end rules
                    messages: {
                        chapter: {
                            required: '请输入章节',
                            digits: "请输入一个整数"
                        }
                    }
                }); // end validate
            }); // end ready()
        </script>
    </head>
    <body>
        <div id="contentWrap">
            <div id="main">
                <h2>编辑选择题</h2>
                <s:form action="choiceedit" method="post" name="signup" id="signup">
                    <s:hidden name="id" value="%{choice.id}"></s:hidden>
                    <div>
                        <label  class="label">课程 </label>
                        <s:textfield name="subject"  value="%{choice.subject}" label="课程"></s:textfield>
                    </div>
                    <div>
                        <label  class="label">章节</label>
                        <s:textfield name="chapter" value="%{choice.chapter}" label="章节"></s:textfield>
                    </div>
                    <div>
                        <label  class="label">章节信息</label>
                        <s:textfield name="chapterinfo" value="%{choice.chapterinfo}" label="章节信息"></s:textfield>
                    </div>
                    <div>
                        <label  class="label">题型</label>
                        <s:select name="type"  value="%{choice.type}" label="题型" list="{'单选题','多选题'}"></s:select>
                    </div>
                    <div>
                        <label  class="label">难度</label>
                        <s:select name="level"  value="%{choice.level}" label="难度" list="{'容易','中等','偏难','难'}"></s:select>
                    </div>
                    <div>
                        <label  class="label">题目内容</label>
                        <s:textarea name="name" value="%{choice.name}" label="题目内容" cols="40" rows="3"></s:textarea>
                    </div>
                    <div>
                        <label  class="label">选项A</label>
                        <s:textarea name="a" value="%{choice.a}" label="选项A" cols="35" rows="2"></s:textarea>
                    </div>
                    <div>
                        <label  class="label">选项B</label>
                        <s:textarea name="b" value="%{choice.b}" label="选项B" cols="35" rows="2"></s:textarea>
                    </div>
                    <div>
                        <label  class="label">选项C</label>
                        <s:textarea name="c" value="%{choice.c}" label="选项C" cols="35" rows="2"></s:textarea>
                    </div>
                    <div>
                        <label  class="label">选项D</label>
                        <s:textarea name="d" value="%{choice.d}" label="选项D" cols="35" rows="2"></s:textarea>
                    </div>
                    <div>
                        <label  class="label">题目答案</label>
                        <s:textarea name="answer" value="%{choice.answer}" label="题目答案" cols="20" rows="1" ></s:textarea>
                    </div>
                    <div>
                        <s:submit value="修改" id="update"></s:submit>
                        <input type="button" id="submit" onclick="history.back()" value="返回" >
                    </div>
                </s:form>
            </div>
        </div>
    </body>
</html>
